package hDOJ;

import java.util.Scanner;

public class Main2045_two {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] res = new long[51];
        res[1] = 3;
        res[2] = 6;
        res[3] = 6;//注意第三个要单独列出，因为有三个元素的话，倒数第二个元素不可能和首元素相同
        for(int i = 4;i<51;++i){
            res[i] = res[i-1] + 2 * res[i-2];
        }

        while(sc.hasNext()){
            System.out.println(res[sc.nextInt()]);
        }
    }
}
